#! /bin/sh #**************************************************************************# # # Module: caeinst.cd # # Description: shell script to install 3rd party required files: # i.e. libraries, frame and examples # # Author: J.Y. Chou # Copyright (c) Altera Corporation 1993 # # Date: 11/05/93 # #***************************************************************************# # syntax: # /caetools/caeinst.cd platform_name cdrom_path mp2_dir # # where platform_name is the platform you install the EDA files, # the valid names are SUNOS, SOLARIS, HP, and RS6000 # cdrom_path is the directory where the cdrom resides # mp2_dir is the directory where maxplus2 installed # # example: # /cdrom/caetools/caeinst.cd sunos /cdrom /usr/maxplus2 #***************************************************************************# # 6/13/95 Added Composer, Concept supports on HP and RS6000; # Not support DEC platform; link vital source file check_sl_dir () { if test -d $mp2dir/simlib -a -d $mp2dir/simlib/$1; then override= while test "$override" != "Y" -a "$override" != "y" -a "$override" != "N" -a "$override" != "n" ; do $ECHO "" $ECHO_N "$mp2dir/simlib/$1 exists. Is it ok to remove existing files? (y/n) " read override done if test "$override" != "y" -a "$override" != "Y"; then $ECHO "Quit 3rd party installation process." exit 1 fi $ECHO "" $ECHO "All files under $mp2dir/simlib/$1 will be removed." rm -rf $mp2dir/simlib/$1 case $? in 0);; *) $ECHO "Unable to remove directory $mp2dir/simlib/$1." $ECHO "Quit 3rd party installation process." exit 1 esac fi if test -d $mp2dir/examples -a -d $mp2dir/examples/$1; then $ECHO "All files under $mp2dir/examples/$1 will be removed." rm -rf $mp2dir/examples/$1 if test $2 = "y"; then $ECHO "" fi case $? in 0);; *) $ECHO "Unable to remove directory $mp2dir/examples/$1." $ECHO "Quit 3rd party installation process." exit 1 esac fi } check_fm_dir () { if test -d $mp2dir/$1; then override=$2 while test "$override" != "Y" -a "$override" != "y" -a "$override" != "N" -a "$override" != "n" ; do $ECHO "" $ECHO_N "$mp2dir/$1 exists. Is it ok to remove existing files? (y/n) " read override done if test "$override" != "y" -a "$override" != "Y"; then $ECHO "Quit 3rd party installation process." exit 1 fi $ECHO "All files under $mp2dir/$1 will be removed." rm -rf $mp2dir/$1 $ECHO "" case $? in 0);; *) $ECHO "Unable to remove directory $mp2dir/$1." $ECHO "Quit 3rd party installation process." exit 1 esac fi } check_space () { diskspace=`$DF $mp2dir | tail +2 | awk '{if ($1 ~ /^[1-9][0-9]*$/) print $3; else print $4}'` if test $diskspace -le $1 ; then $ECHO "" $ECHO "There is not enough disk space, only $diskspace Kbytes left." exit fi } untar_file () { tar xf $cdloc/$1 case $? in 0);; *) $ECHO "Unable to un-tar file $cdloc/$1 " $ECHO "Quit 3rd party interface installation." exit 1 esac } link_vital_src () { if [ -d $mp2dir/max2vhdl/vital/$2 ]; then cd $1 ln -s $mp2dir/max2vhdl/vital/$2/alt_vtl.vhd alt_vtl.vhd ln -s $mp2dir/max2vhdl/vital/$2/alt_vtl.cmp alt_vtl.cmp fi; } inst_edif_netlister () { if test -d $mp2dir/cadence/share/netlist ; then cd $mp2dir/cadence/share/netlist if test $machty = "SUNOS" -o "$machty" = "sunos"; then mv altNetlist_sunos.tar altNetlist.tar rm -f altNetlist_hp.tar rm -f altNetlist_ibm.tar rm -f altNetlist_solaris.tar else if test $machty = "HP" -o "$machty" = "hp"; then mv altNetlist_hp.tar altNetlist.tar rm -f altNetlist_sunos.tar rm -f altNetlist_ibm.tar rm -f altNetlist_solaris.tar else if test $machty = "RS6000" -o "$machty" = "rs6000"; then mv altNetlist_ibm.tar altNetlist.tar rm -f altNetlist_sunos.tar rm -f altNetlist_hp.tar rm -f altNetlist_solaris.tar else if test $machty = "SOLARIS" -o "$machty" = "solaris"; then mv altNetlist_solaris.tar altNetlist.tar rm -f altNetlist_sunos.tar rm -f altNetlist_hp.tar rm -f altNetlist_ibm.tar fi fi fi fi # # Install concept2alt, vlog2alt netlisters # if test -d $mp2dir/cadence/bin ; then cd $mp2dir/cadence/bin # # Install netlists # tar xfp $mp2dir/cadence/share/netlist/altNetlist.tar fi fi } generate_dev_list () { if test -d $mp2dir/cadence/bin ; then cd $mp2dir/cadence/bin # # Generate dev_list.dat from the # /usr/maxplus2/common/package.dat file. # if test -x generate_dev_list.csh -a -f $mp2dir/common/package.dat; then `./generate_dev_list.csh $mp2dir/common/package.dat` else $ECHO " " $ECHO "Can not find $mp2dir/common/package.dat." $ECHO "File dev_list.dat is not generated." $ECHO " " fi fi } inst_composer_edif_yes_no () { while test "$cad_edif" != "Y" -a "$cad_edif" != "y" -a "$cad_edif" != "N" -a "$cad_edif" != "n" ; do $ECHO "" $ECHO_N "Would you like to install the Composer edif netlister?(y/n) " read cad_edif done if test "$cad_edif" = "y" -o "$cad_edif" = "Y"; then cds_root_path=$CDS_INST_DIR if test -x $cds_root_path/tools/bin/cds_root ; then cds_root_path=`$cds_root_path/tools/bin/cds_root`; fi if test "$cds_root_path" = ""; then # give the user a chance to give the cadence hierarchy path. get_new_path=N new_path= while test "$get_new_path" != "Y" ; do $ECHO "" $ECHO_N "Type the full pathname to the Cadence hierarchy:" read new_path if test -n "$new_path"; then if test -w $new_path -a -x $new_path; then cds_root_path=$new_path get_new_path=Y else $ECHO " Sorry, $new_path is not a valid directory name or is not writable." fi else get_new_path=Y fi done if test "$cds_root_path" = "" ; then $ECHO "Cannot find the Cadence installation path." $ECHO "Composer edif netlister is not installed." cad_edif=N fi if test -w $cds_root_path ; then $ECHO_N "" else $ECHO_N "You have no write permision on directory: " $ECHO "$cds_root_path." cad_edif=N fi else install_ok= while test "$install_ok" != "Y" -a "$install_ok" != "y" -a "$install_ok" != "N" -a "$install_ok" != "n" ; do $ECHO "" $ECHO_N "Install Composer edif netlister under " $ECHO_N "$cds_root_path? (y/n) " read install_ok done if test "$install_ok" = "n" -o "$install_ok" = "N"; then $ECHO "Composer edif netlister is not installed." cad_edif=N fi fi if test "$cad_edif" = "y" -o "$cad_edif" = "Y"; then if test -f $cds_root_path/tools/dfII/etc/skill/hnl/altout.ile ; then if test -w $cds_root_path/tools/dfII/etc/skill/hnl/altout.ile ; then override= while test "$override" != "Y" -a "$override" != "y" -a "$override" != "N" -a "$override" != "n" ; do $ECHO "" $ECHO_N "$cds_root_path/tools/dfII/etc/skill/hnl/altout.ile exists. Is it ok to overwrite the existing file? (y/n) " read override done if test "$override" != "y" -a "$override" != "Y"; then $ECHO "Composer edif netlister is not installed." cad_edif=N fi else $ECHO "Can't overwrite $cds_root_path/tools/dfII/etc/skill/hnl/altout.ile." $ECHO "Composer edif netlister is not installed." cad_edif=N fi fi fi fi } inst_composer_netlister () { $ECHO "Install the Composer edif netlister ..." # install dfII files cd $cds_root_path if test -w $cds_root_path; then if test -f $mp2dir/cadence/share/netlist/altDFIINet.tar ; then tar xfp $mp2dir/cadence/share/netlist/altDFIINet.tar else $ECHO "Can't find $mp2dir/cadence/share/netlist/altDFIINet.tar." $ECHO "Composer edif netlister is not installed." fi fi } cleanup_cadence_vlg_dir() { cd $mp2dir/cadence/share/verilog if test $machty = "SUNOS" -o "$machty" = "sunos"; then if [ -f convert_hex2ver_sunos.obj ];then mv convert_hex2ver_sunos.obj convert_hex2ver.o rm convert_hex2ver_hp.obj rm convert_hex2ver_ibm.obj rm convert_hex2ver_solaris.obj fi else if test $machty = "HP" -o "$machty" = "hp"; then if [ -f convert_hex2ver_hp.obj ];then mv convert_hex2ver_hp.obj convert_hex2ver.o rm convert_hex2ver_sunos.obj rm convert_hex2ver_ibm.obj rm convert_hex2ver_solaris.obj fi else if test $machty = "RS6000" -o "$machty" = "rs6000"; then if [ -f convert_hex2ver_ibm.obj ];then mv convert_hex2ver_ibm.obj convert_hex2ver.o rm convert_hex2ver_sunos.obj rm convert_hex2ver_hp.obj rm convert_hex2ver_solaris.obj fi else if test $machty = "SOLARIS" -o "$machty" = "solaris"; then if [ -f convert_hex2ver_solaris.obj ];then mv convert_hex2ver_solaris.obj convert_hex2ver.o rm convert_hex2ver_sunos.obj rm convert_hex2ver_hp.obj rm convert_hex2ver_ibm.obj fi fi fi fi fi; } inst_composer () { if test "$cad_tar" = " "; then $ECHO "Composer is not supported on $machty" else cd $mp2dir check_sl_dir composer n check_fm_dir composer y check_space $cad_sp $ECHO "Installing Cadence-Composer ..." untar_file $cad_tar cd $mp2dir/simlib/composer tar xf $synthesis_lib rm -f $synthesis_lib cleanup_cadence_vlg_dir if [ ! -d $mp2dir/simlib/composer/alt_vtl ]; then mkdir $mp2dir/simlib/composer/alt_vtl fi if [ ! -d $mp2dir/simlib/composer/alt_vtl/src ]; then mkdir $mp2dir/simlib/composer/alt_vtl/src fi link_vital_src $mp2dir/simlib/composer/alt_vtl/src v3_0; # generate dev_list.dat file generate_dev_list # install edif netlister inst_edif_netlister # Install Edif netlist writer if test $cad_edif = "Y" -o "$cad_edif" = "y"; then inst_composer_netlister fi fi } inst_concept () { if test "$vld_tar" = " "; then $ECHO "Concept is not supported on $machty" else cd $mp2dir check_sl_dir concept y check_space $vld_sp $ECHO "Installing Cadence-Concept ..." untar_file $vld_tar # untar Cadence synthesis library cd $mp2dir/simlib/composer tar xf $synthesis_lib rm -f $synthesis_lib cleanup_cadence_vlg_dir if [ ! -d $mp2dir/simlib/concept/alt_vtl ]; then mkdir $mp2dir/simlib/concept/alt_vtl fi if [ ! -d $mp2dir/simlib/concept/alt_vtl/src ]; then mkdir $mp2dir/simlib/concept/alt_vtl/src fi link_vital_src $mp2dir/simlib/concept/alt_vtl/src v3_0; # generate dev_list.dat file generate_dev_list # install edif netlister inst_edif_netlister fi } inst_mentor () { if test "$mto_tar" = " "; then $ECHO "Mentor Graphics is not supported on $machty" else cd $mp2dir check_sl_dir mentor n check_fm_dir mentor y check_space $mto_sp $ECHO "Installing Mentor Graphics ..." untar_file $mto_tar if test $machty = "SUNOS" -o "$machty" = "sunos"; then mv -f $mp2dir/mentor/max2/fonts.sparc $mp2dir/mentor/max2/fonts rm -rf $mp2dir/mentor/max2/fonts.hp700 rm -rf $mp2dir/mentor/max2/fonts.solaris else if test $machty = "HP" -o "$machty" = "hp"; then mv -f $mp2dir/mentor/max2/fonts.hp700 $mp2dir/mentor/max2/fonts rm -rf $mp2dir/mentor/max2/fonts.sparc rm -rf $mp2dir/mentor/max2/fonts.solaris else if test $machty = "SOLARIS" -o "$machty" = "solaris"; then mv -f $mp2dir/mentor/max2/fonts.solaris $mp2dir/mentor/max2/fonts rm -rf $mp2dir/mentor/max2/fonts.sparc rm -rf $mp2dir/mentor/max2/fonts.hp700 # else # if test $machty = "DEC" -o "$machty" = "dec"; then # mv -f $mp2dir/mentor/max2/fonts.sparc $mp2dir/mentor/max2/fonts # rm -rf $mp2dir/mentor/max2/fonts.hp700 # rm -rf $mp2dir/mentor/max2/fonts.solaris # fi fi fi fi link_vital_src $mp2dir/simlib/mentor/alt_vtl v2_2b; fi } inst_synopsys () { if test "$syn_tar" = " "; then $ECHO "Synopsys is not supported on $machty" else cd $mp2dir check_fm_dir synopsys check_space $syn_sp $ECHO "Installing Synopsys ..." untar_file $syn_tar link_vital_src $mp2dir/synopsys/library/alt_post/sim/src v3_0; fi } inst_viewlogic () { if test "$vwl_tar" = " "; then $ECHO "Viewlogic is not supported on $machty" else cd $mp2dir check_fm_dir viewlogic check_space $vwl_sp $ECHO "Installing Viewlogic ..." untar_file $vwl_tar if [ ! -d $mp2dir/viewlogic/library/alt_vtl ]; then mkdir $mp2dir/viewlogic/library/alt_vtl fi if [ ! -d $mp2dir/viewlogic/library/alt_vtl/src ]; then mkdir $mp2dir/viewlogic/library/alt_vtl/src fi link_vital_src $mp2dir/viewlogic/library/alt_vtl/src v2_2b; fi } # platform must be given at the first place if test "$#" -eq "0"; then echo "" echo "You should enter the platform type (SUNOS/SOLARIS/HP/RS6000)." echo "" exit 1 fi if test "$#" -eq "1"; then machty=$1 elif test "$#" -eq "2"; then machty="$1" cdloc="$2" elif test "$#" -eq "3"; then machty=$1 cdloc=$2 mp2dir=$3 fi if test "$machty" = ""; then echo "" echo -n "Type the platform name (SUNOS/SOLARIS/HP/RS6000) [SUNOS] " read machty if test "$machty" = "" ; then machty='SUNOS' fi fi while test "$machty" != "SUNOS" -a "$machty" != "sunos" -a \ "$machty" != "HP" -a "$machty" != "hp" -a \ "$machty" != "RS6000" -a "$machty" != "rs6000" -a \ "$machty" != "SOLARIS" -a "$machty" != "solaris" ; do echo "" echo "Invalid platform name" exit 1 done if test "$machty" = "SUNOS" -o "$machty" = "sunos"; then ECHO=/bin/echo ECHO_N="/bin/echo -n" DF=df cad_tar='caetools/composer.tar' vld_tar='caetools/concept.tar' mto_tar='caetools/mentor.tar' syn_tar='caetools/synopsys.tar' vwl_tar='caetools/vwlogic.tar' # tar the synthesis lib to avoid the file name too long when doing untar synthesis_lib='alt_syn.tar' cad_edif=N cad_sp=7000 vld_sp=1100 mto_sp=18000 syn_sp=15000 vwl_sp=2000 fi if test "$machty" = "SOLARIS" -o "$machty" = "solaris"; then ECHO=/bin/echo ECHO_N="/bin/echo" DF="df -k" cad_tar='caetools/composer.tar' vld_tar='caetools/concept.tar' mto_tar='caetools/mentor.tar' syn_tar='caetools/synopsys.tar' vwl_tar='caetools/vwlogic.tar' # tar the synthesis lib to avoid the file name too long when doing untar synthesis_lib='alt_syn.tar' cad_edif=N cad_sp=7000 vld_sp=1100 mto_sp=18000 syn_sp=15000 vwl_sp=2000 fi if test "$machty" = "RS6000" -o "$machty" = "rs6000"; then ECHO=/bin/echo ECHO_N="/bin/echo -n" DF="df -v" cad_tar='caetools/composer.tar' vld_tar='caetools/concept.tar' # mto_tar='caetools/mentor.tar' mto_tar=' ' syn_tar='caetools/synopsys.tar' vwl_tar='caetools/vwlogic.tar' # tar the synthesis lib to avoid the file name too long when doing untar synthesis_lib='alt_syn.tar' cad_edif=N cad_sp=7000 vld_sp=1100 mto_sp=18000 syn_sp=15000 vwl_sp=2000 fi if test "$machty" = "HP" -o "$machty" = "hp"; then ECHO=/bin/echo ECHO_N="/bin/echo" DF=bdf cad_tar='CAETOOLS/COMPOSER.TAR;1' vld_tar='CAETOOLS/CONCEPT.TAR;1' mto_tar='CAETOOLS/MENTOR.TAR;1' syn_tar='CAETOOLS/SYNOPSYS.TAR;1' vwl_tar='CAETOOLS/VWLOGIC.TAR;1' # tar the synthesis lib to avoid the file name too long when doing untar synthesis_lib='alt_syn.tar' cad_edif=N cad_sp=7000 vld_sp=1100 mto_sp=18000 syn_sp=15000 vwl_sp=2000 fi # if test "$machty" = "DEC" -o "$machty" = "dec"; then # ECHO=/bin/echo # ECHO_N="/bin/echo -n" # DF=df # # cad_tar='CAETOOLS/COMPOSER.TAR;1' # cad_tar=' ' # # vld_tar='CAETOOLS/CONCEPT.TAR;1' # vld_tar=' ' # # mto_tar='CAETOOLS/MENTOR.TAR;1' # mto_tar=' ' # # syn_tar='CAETOOLS/SYNOPSYS.TAR;1' # syn_tar=' ' # vwl_tar='CAETOOLS/VWLOGIC.TAR;1' # # tar the synthesis lib to avoid the file name too long when doing untar # synthesis_lib='alt_syn.tar' # cad_edif=N # 512 blocks on DEC # cad_sp=10000 # vld_sp=16000 # mto_sp=30000 # syn_sp=18000 # vwl_sp=4000 # fi if test "$cdloc" = ""; then $ECHO "" $ECHO "Type the full pathname of the directory where the MAX+PLUS II" $ECHO "CD-ROM is mounted (default: /cdrom):" read cdloc if test "$cdloc" = "" ; then cdloc='/cdrom' fi fi if test "$mp2dir" = ""; then $ECHO "" $ECHO "Type the full pathname of the directory where the MAX+PLUS II" $ECHO "is installed (default: /usr/maxplus2):" read mp2dir if test "$mp2dir" = "" ; then mp2dir='/usr/maxplus2' fi fi cd $mp2dir clear $ECHO "" $ECHO "Third-Party Interfaces Installation:" $ECHO "" $ECHO " 1. Cadence-Composer 7.0 Mbytes" $ECHO " 2. Cadence-Concept 11.0 Mbytes" $ECHO " 3. Mentor Graphics 18.0 Mbytes" $ECHO " 4. Synopsys 15.0 Mbytes" $ECHO " 5. Viewlogic 2.0 Mbytes" $ECHO " 6. All" $ECHO " 7. Quit" $ECHO "" $ECHO_N "Enter one or more numbers: " read vendor_in vendor=`$ECHO "$vendor_in" | sed "s/,/ /g"` for usr_input in $vendor do while test "$usr_input" != "1" -a "$usr_input" != "2" -a "$usr_input" != "3" \ -a "$usr_input" != "4" -a "$usr_input" != "5" -a "$usr_input" != "6" \ -a "$usr_input" != "7" ; do $ECHO "" $ECHO_N "(choose vlaid number(s) please, i.e. 4,5):" read usr_input done case $usr_input in 1 ) cad_edif= inst_composer_edif_yes_no inst_composer ;; 2 ) inst_concept ;; 3 ) inst_mentor ;; 4 ) inst_synopsys ;; 5 ) inst_viewlogic ;; 6 ) cad_edif= inst_composer_edif_yes_no inst_composer inst_concept inst_mentor inst_synopsys inst_viewlogic ;; 7 ) break;; esac done $ECHO ""